package svc

import (
	"github.com/zeromicro/go-zero/zrpc"
	"zg6/zg6_month/client/internal/config"
	"zg6/zg6_month/goodssrv/goodssrvclient"
	"zg6/zg6_month/ordersrv/ordersrvclient"
)

type ServiceContext struct {
	Config   config.Config
	OrderSrv ordersrvclient.Ordersrv
	GoodsSrv goodssrvclient.Goodssrv
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:   c,
		OrderSrv: ordersrvclient.NewOrdersrv(zrpc.MustNewClient(c.OrderSrv)),
		GoodsSrv: goodssrvclient.NewGoodssrv(zrpc.MustNewClient(c.GoodsSrv)),
	}
}
